import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/Base_Manage/Home/SubmitLogin',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/Base_Manage/Home/GetOperatorInfo',
    method: 'post'
  })
}
// 货区全部仓库
export function getCangku(input) {
  return request({
    url: '/PB/PB_Storage/GetDataList',
    method: 'post',
    data: {
      pageIndex: 1,
      pageRows: 10,
      search: {
        keyword: input
      }
    }
  })
}
// 添加仓库
export function addCangku(data) {
  return request({
    url: '/PB/PB_Storage/SaveData',
    method: 'post',
    data: {
      IsDefault: false,
      IsTray: false,
      false: false,
      Name: data.name,
      Remarks: data.type,
      Type: data.cangku,
      disable: false
    }
  })
}
// 删除仓库
export function delCangku(data) {
  return request({
    url: '/PB/PB_Storage/DeleteData',
    method: 'post',
    data
  })
}
// 获取全部巷道
export function getXiangdao(data) {
  return request({
    url: '/PB/PB_Laneway/GetDataList',
    method: 'post',
    data: {
      pageIndex: 1,
      pageRows: 10,
      StorId: data,
      search: {
        keyword: data?.keyword
      }
    }
  })
}
// 查询巷道
export function getXi(data) {
  return request({
    url: '/PB/PB_Laneway/GetDataList',
    method: 'post',
    data: {
      StorId: data.StorId,
      pageIndex: 1,
      pageRows: 10,
      search: {
        keyword: data.Keyword
      }
    }
  })
}
// 新增巷道
export function addXiangdao(data) {
  return request({
    url: '/PB/PB_Laneway/SaveData',
    method: 'post',
    data
  })
}
// 删除巷道
export function delxiangdao(data) {
  return request({
    url: '/PB/PB_Laneway/DeleteData',
    method: 'post',
    data
  })
}
// 获取单个巷道详细信息
export function getXiangdaoInfo(data) {
  return request({
    url: '/PB/PB_Laneway/GetTheData',
    method: 'post',
    data
  })
}

// 获取货架
export function getHuoJia(data) {
  return request({
    url: '/PB/PB_Rack/GetDataList',
    method: 'post',
    data: {
      StorId: data.HJ_id,
      pageIndex: 1,
      pageRows: 10,
      search: {
        keyword: data.Name
      }
    }
  })
}
// 新增货架
export function addHuoJia(data) {
  return request({
    url: '/PB/PB_Rack/SaveData',
    method: 'post',
    data
  })
}
// 删除货架
export function delHuoJia(data) {
  return request({
    url: '/PB/PB_Rack/DeleteData',
    method: 'post',
    data
  })
}
// 获取货架详细
export function getHuoJiaInfo(data) {
  return request({
    url: '/api/PB/PB_Rack/GetTheData',
    method: 'post',
    data
  })
}

// 获取配置
export function getPeiZhi(data) {
  return request({
    url: '/PB/PB_Storage/GetTheData',
    method: 'post',
    data
  })
}
// 获取被编辑仓库详细信息
export function getbianji(data) {
  return request({
    url: '/PB/PB_Storage/GetTheData',
    method: 'post',
    data
  })
}
// 确认编辑
export function addBianjiInfo(data) {
  return request({
    url: '/PB/PB_Storage/SaveData',
    method: 'post',
    data
  })
}
